<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title>网站信息</title>
<link rel="stylesheet" href="HNUST/../../user/css/pintuer.css">
<link rel="stylesheet" href="HNUST/../../user/css/admin.css">
<script src="HNUST/../../user/js/jquery.js"></script>
<script src="HNUST/../../user/js/pintuer.js"></script>

<link rel="stylesheet" type="text/css"
	href="HNUST/../../dist/css/wangEditor.min.css">
<!--引入jquery和wangEditor.js-->
<!--注意：javascript必须放在body最后，否则可能会出现问题-->
<script src="HNUST/../../dist/js/lib/jquery-1.10.2.min.js"></script>
<script src="HNUST/../../dist/js/wangEditor.min.js"></script>
<style type="text/css">
#editor-trigger {
	height: 400px;
	/*max-height: 500px;*/
}

.container {
	width: 100%;
	margin: 0 auto;
	position: relative;
}
</style>
<script type="text/javascript">
	$(function() {
		var path, clip = $("#allUrl"), FileReader = window.FileReader;
		$("#file").change(function() {
			if (FileReader) {//chrome浏览器处理  
				var reader = new FileReader(), file = this.files[0];
				reader.onload = function(e) {
					clip.attr("src", e.target.result);//这里是把图片转成64位数据存入<img>中的src里  
				};
				reader.readAsDataURL(file);
				//这里需要延迟一下，否则无法放入文本框内  
				//setTimeout("showchange()",1000);  
			} else {//其他浏览器处理，火狐在这里就不写出来了，网上资料很多  
				path = $(this).val();
				if (/"\w\W"/.test(path)) {
					path = path.slice(1, -1);
				}
				clip.attr("src", path);
			}
		});

	})
</script>
</head>
<body>
	<div class="panel admin-panel">
		<div class="panel-head">
			<strong><span class="icon-pencil-square-o"></span> 网站信息</strong>
		</div>
		<div class="body-content">
			<form method="post" class="form-x" action="sceniczj"
				enctype="multipart/form-data">

				<input type="hidden" class="input" name="scenic_id" />


				<div class="form-group">
					<div class="label">
						<label>景点标题：</label>
					</div>
					<div class="field">
						<input type="text" class="input" name="scenic_name" value=""
							data-validate="required:请输入景区名" />
						<div class="tips"></div>
					</div>
				</div>

				<div class="form-group">
					<div class="label">
						<label>价格：</label>
					</div>
					<div class="field">
						<input type="text" class="input" name="scenic_jg" value=""
							data-validate="required:请输入价格" />
						<div class="tips"></div>
					</div>
				</div>

				<div class="form-group">
					<div class="label">
						<label>景点图：</label>
					</div>
					<div class="field">
						<img
							id="allUrl" src="" width="200" height="229" />
							<input
							type="file" name="pic"
							accept="image/gif,image/jpeg,image/jpg" id="file"/>

					</div>
				</div>
				<div class="form-group">
					<div class="label">
						<label>地区：</label>
					</div>
					<div class="field">
						<select name="scenic_dq" class="input w50">
							<option value="鼎城区">鼎城区</option>
							<option value="武陵区">武陵区</option>
							<option value="安乡县">安乡县</option>
							<option value="汉寿县">汉寿县</option>
							<option value="津市">津市</option>
							<option value="桃源县">桃源县</option>
							<option value="澧县">澧县</option>
							<option value="石门县">石门县</option>
							<option value="临澧县">临澧县</option>
						</select>
						<div class="tips"></div>
					</div>
				</div>

				<div class="form-group">
					<div class="label">
						<label>留言：</label>
					</div>
					<div class="field">
						<textarea id="textarea1" style="height: 400px; max-height: 400px;"
							name="scenic_jj">
    <p>请输入内容...</p>
</textarea>
						<div class="tips"></div>
					</div>
				</div>
				<!--这里引用jquery和wangEditor.js-->
				<script type="text/javascript">
					// 获取元素
					var textarea = document.getElementById('textarea1');
					// 生成编辑器
					var editor = new wangEditor(textarea);
					editor.create();
				</script>
				<div class="form-group">
					<div class="label">
						<label></label>
					</div>
					<div class="field">
						<button class="button bg-main icon-check-square-o" type="submit">
							提交</button>
					</div>
				</div>
			</form>
		</div>
	</div>
	<script type="text/javascript">
		// 阻止输出log
		// wangEditor.config.printLog = false;

		var editor = new wangEditor('editor-trigger');

		// 上传图片
		editor.config.uploadImgUrl = '/upload';
		editor.config.uploadParams = {
		// token1: 'abcde',
		// token2: '12345'
		};
		editor.config.uploadHeaders = {
		// 'Accept' : 'text/x-json'
		}
		// editor.config.uploadImgFileName = 'myFileName';

		// 隐藏网络图片
		// editor.config.hideLinkImg = true;

		// 表情显示项
		editor.config.emotionsShow = 'value';
		editor.config.emotions = {
			'default' : {
				title : '默认',
				data : './emotions.data'
			},
			'weibo' : {
				title : '微博表情',
				data : [
						{
							icon : 'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/7a/shenshou_thumb.gif',
							value : '[草泥马]'
						},
						{
							icon : 'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/60/horse2_thumb.gif',
							value : '[神马]'
						},
						{
							icon : 'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/bc/fuyun_thumb.gif',
							value : '[浮云]'
						},
						{
							icon : 'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/c9/geili_thumb.gif',
							value : '[给力]'
						},
						{
							icon : 'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/f2/wg_thumb.gif',
							value : '[围观]'
						},
						{
							icon : 'http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/70/vw_thumb.gif',
							value : '[威武]'
						} ]
			}
		};

		// 插入代码时的默认语言
		// editor.config.codeDefaultLang = 'html'

		// 只粘贴纯文本
		// editor.config.pasteText = true;

		// 跨域上传
		// editor.config.uploadImgUrl = 'http://localhost:8012/upload';

		// 第三方上传
		// editor.config.customUpload = true;

		// 普通菜单配置
		// editor.config.menus = [
		//     'img',
		//     'insertcode',
		//     'eraser',
		//     'fullscreen'
		// ];
		// 只排除某几个菜单（兼容IE低版本，不支持ES5的浏览器），支持ES5的浏览器可直接用 [].map 方法
		// editor.config.menus = $.map(wangEditor.config.menus, function(item, key) {
		//     if (item === 'insertcode') {
		//         return null;
		//     }
		//     if (item === 'fullscreen') {
		//         return null;
		//     }
		//     return item;
		// });

		// onchange 事件
		editor.onchange = function() {
			console.log(this.$txt.html());
		};

		// 取消过滤js
		// editor.config.jsFilter = false;

		// 取消粘贴过来
		// editor.config.pasteFilter = false;

		// 设置 z-index
		// editor.config.zindex = 20000;

		// 语言
		// editor.config.lang = wangEditor.langs['en'];

		// 自定义菜单UI
		// editor.UI.menus.bold = {
		//     normal: '<button style="font-size:20px; margin-top:5px;">B</button>',
		//     selected: '.selected'
		// };
		// editor.UI.menus.italic = {
		//     normal: '<button style="font-size:20px; margin-top:5px;">I</button>',
		//     selected: '<button style="font-size:20px; margin-top:5px;"><i>I</i></button>'
		// };
		editor.create();
	</script>
</body>
</html>